package com.telsoft.hms.function;

import com.telsoft.hms.data.HMS_News_DATA;
import com.telsoft.hms.data.HMS_Title_DATA;
import com.telsoft.hms.lib.security.session.Session;
import com.telsoft.hms.util.SessionUtil;

public class HMS_News_FUNC {

	private final HMS_News_DATA newsData;

	public HMS_News_FUNC() {
		newsData = new HMS_News_DATA();
	}

	/**
	 * Xóa tin tức
	 * @author ToiVT
	 * @param strSecurityKey
	 *            Mã bảo mật
	 * @param lId
	 *            id tin tức
	 * @param languageCode
	 *            Mã ngôn ngữ
	 * @throws Exception
	 * Ngày tạo: 08/10/2014
	 */
	public boolean deleteNews(String strSecurityKey, long lIdNews,
			int languageCode) throws Exception {
		if (lIdNews <= 0) {
			throw new Exception("ERR-0001");
		}
		if (languageCode <= 0) {
			throw new Exception("ERR-0002");
		}
		Session session;
		try {
			session = SessionUtil.getSession(strSecurityKey);
		} catch (Exception ex) {
			throw ex;
		}
		return newsData.deleteNews(session.getHospitalKey(), lIdNews,
				languageCode);
	}
}
